﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Business;
using DTO;

namespace Presentation
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void Form3_Load(object sender, EventArgs e)
        {

        }

        private void btndangnhap_Click(object sender, EventArgs e)
        {
            NhanVienDTO nhanvienDTO = new NhanVienDTO();
            int username = Convert.ToInt32(txttendangnhap.Text.ToString());
            string pass = txtmatkhau.Text;
            nhanvienDTO = NhanVienService.Login(username, pass);
            if (nhanvienDTO.MaNhanVien == 0)
            {
                MessageBox.Show("Đăng Nhập Sai Roài");
            }
            else
            {
                Form1 frm1 = new Form1();
                frm1.SetVisible();
                frm1.Show();
                this.Close();
            }
        }

        private void btnthoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
